//
//  DiscountBGHotVC.m
//  AroundTheWorld
//
//  Created by dllo on 16/5/20.
//  Copyright © 2016年 IfelseGo an. All rights reserved.
//

#import "DiscountBGHotVC.h"
#define WIDTH self.view.frame.size.width
#define HEIGHT self.view.frame.size.height
@interface DiscountBGHotVC ()

@end

@implementation DiscountBGHotVC

- (void)viewDidLoad {
    self.view.backgroundColor = [UIColor whiteColor];
    
    UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 60, WIDTH, HEIGHT - 60)];
    [webView setUserInteractionEnabled:YES];//是否支持交互
    //[webView setDelegate:self];
    //webView.delegate=self;
    [webView setOpaque:NO];//opaque是不透明的意思
    [webView setScalesPageToFit:YES];//自动缩放以适应屏幕
    [self.view addSubview:webView];
    NSString *string = @"http://m.qyer.com/z/topic.php?action=newPreview&topic_id=619&source=app&client_id=qyer_ios&track_user_id=&track_deviceid=CBF73BD2-C65E-4BC1-9574-89BDE1EE9C36&track_app_version=6.8.5";
    
    //加载网页的方式
    //1.创建并加载远程网页
    NSURL *url = [NSURL URLWithString:string];
    [webView loadRequest:[NSURLRequest requestWithURL:url]];
    
    UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(50, 15, WIDTH - 100, 60)];
    label.text = @"专题";
    label.textAlignment = NSTextAlignmentCenter;
    [self.view addSubview:label];
    
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    button.frame = CGRectMake(18, 35, 20, 20);
    button.backgroundColor = [UIColor clearColor];
    [button setBackgroundImage:[UIImage imageNamed:@"btn-fanhui64x64"] forState:UIControlStateNormal];
    [self.view addSubview:button];
    [button addTarget:self action:@selector(buttonAtcion) forControlEvents:UIControlEventTouchUpInside];
     
    // Do any additional setup after loading the view.
}
- (void)buttonAtcion
{
    [self dismissViewControllerAnimated:YES completion:^{
        
        
    }];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
